package edu.poly.game.battleship;

import edu.poly.game.player.MissileFireResultType;
import edu.poly.game.util.Coordinate;
import edu.poly.game.util.Dimension;

/**
 * BattleShip interface, defines the contract necessary methods required for this game
 * this interface will be used in other places, we don't care it's underlying implementation,
 * decoupling dependencies
 * 
 * since battle ship is represented as a rectangle or square, it should have a start and end
 * coordinate to represent it
 * @author kevint
 */
public interface BattleShip {
	/**
	 * ship name
	 * @return name associated this this ship
	 */
	String getName();
	
	/**
	 * return the starting coordinate of this ship
	 * @return from coordinate
	 */
	Coordinate getFromCoordinate();
	
	/**
	 * return the ending coordinate of this ship
	 * @return to coordinate
	 */
	Coordinate getToCoordinate();
	
	/**
	 * main method for taking a hit, return true if hit successful
	 * return false if not hit
	 * @param missileCoordinate
	 * @return true, false based on successful hit
	 */
	MissileFireResultType takeMissileHit(final Coordinate missileCoordinate);
	
	/**
	 * return battle ship type
	 * @return
	 */
	BattleShipType getBattleShipType();
	
	/**
	 * returns if this ship has been destroyed
	 * @return ship destroyed
	 */
	boolean isDestroyed();
	
	/**
	 * get this ship's orientation type, horizontal or verticle
	 * @return ship orientation
	 */
	Orientation getOrientation();
	
	/**
	 * get ship's dimension, width and height
	 * @return width
	 */
	Dimension getShipDimension();
	
	//boolean isWithinRange(final Coordinate coordinate);
}
